package com.xyht.sca_s.student_manage_system.modules.welcomeNewStudent.controller;


import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.welcomeNewStudent.entity.req.SmsWnsBookFeesPlanReq;
import com.xyht.sca_s.student_manage_system.modules.welcomeNewStudent.entity.req.SmsWnsIdListReq;
import com.xyht.sca_s.student_manage_system.modules.welcomeNewStudent.service.SmsWnsBookFeesPlanService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 书杂费计划表 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2024-04-08
 */
@RestController
@RequestMapping("/welcomeNewStudent/bookFeesPlan")
@SecretBody
public class SmsWnsBookFeesPlanController {
    @Resource
    private SmsWnsBookFeesPlanService smsWnsBookFeesPlanService;

    @ApiOperation("添加书杂费计划")
    @PostMapping("/add")
    public ResponseResult addPlan(@RequestBody SmsWnsBookFeesPlanReq req) {
        return smsWnsBookFeesPlanService.addPlan(req);
    }

    @ApiOperation("删除书杂费计划")
    @PostMapping("/del")
    public ResponseResult delPlan(@RequestBody SmsWnsIdListReq req) {
        return smsWnsBookFeesPlanService.delPlan(req);
    }

    @ApiOperation("修改书杂费计划")
    @PostMapping("/update")
    public ResponseResult updatePlan(@RequestBody SmsWnsBookFeesPlanReq req) {
        return smsWnsBookFeesPlanService.updatePlan(req);
    }

    @ApiOperation("查询书杂费计划列表")
    @GetMapping("/list")
    public ResponseResult listPlan(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                   @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                   @RequestParam(value = "searchStr", required = false) String searchStr) {
        return smsWnsBookFeesPlanService.listPlan(pageNum, pageSize, searchStr);
    }

}

